package com.mark.design.pattern.creational.prototype.clone;

import java.util.Date;

/**
 * Created by Choisaaaa on 2018/8/20.
 */
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Date birthday = new Date(0L);
        Pig pig1 = new Pig("佩奇", birthday);
        Pig pig2 = (Pig) pig1.clone();
        System.out.println(pig1);
        System.out.println(pig2);
        System.out.println("------------------------");
        pig1.getBirthdate().setTime(666666666L);
        System.out.println(pig1);
        System.out.println(pig2);

    }
}
